<template>
  <div>
    <div class="item" v-for="(item, index) in props.menuList" :key="item">
      {{ item }}
      <button @click="() => handleClick(index)">删除</button>
    </div>
  </div>
</template>
<script setup>
import { defineProps } from "vue";
const props = defineProps({
  menuList: {
    type: Array,
    required: true,
  },
});

const emits = defineEmits(["delete"]);

const handleClick = (index) => {
  //   emits("delete", index);
  props.menuList.splice(index, 1);
  props.menuList.map((item) => item + "fdsfds");
  //   props.menuList = [];
};
</script>
<style></style>
